<!DOCTYPE html>
<html lang="en">
<head>
    <title>运营管理后台</title>
    <meta name="description" content="overview &amp; stats"/>
    #parse("include/head.html")

    <style>

        /*.main-content, .main-content-inner {*/
        /*max-width: 100%;*/
        /*min-height: 100%;*/
        /*overflow-x: hidden;*/
        /*overflow-y: auto;*/
        /*}*/

        /*body {*/
        /*overflow: hidden;*/
        /*}*/

        .embed-responsive
        .responsive-video iframe,
        .responsive-video object,
        .responsive-video embed {
            position: absolute;
            top: 5px;
            right: 5px;
            top: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            min-height: 100%;
        }

        .embed-responsive .embed-responsive-16by9 {
            padding-bottom: 56.25%;
        }

        #mainFrame {
            min-height: 100%;
            z-index: 5;
            overflow-x: hidden;
        }

        /*#loader-wrapper {*/
            /*position: fixed;*/
            /*background-color: transparent;*/
            /*top: 50%;*/
            /*left: 50%;*/
            /*margin-top: -100px;*/
            /*margin-left: -100px;*/
        /*}*/
        /*#loader-wrapper .loader-section.section-left {*/
            /*left: 0;*/
        /*}*/
        /*#loader-wrapper .loader-section.section-right {*/
            /*right: 0;*/
        /*}*/

    </style>
    <!--<link rel="stylesheet" href="http://css-spinners.com/css/spinner/heartbeat.css" type="text/css">-->
</head>

<body class="no-skin">
#parse("include/navbar.html")
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    #parse("include/sidebar.html")

    <div class="main-content">

        <div class="main-content-inner">
            <!--<div class="embed-responsive embed-responsive-16by9 embed-responsive-4by3">-->
            <!--&lt;!&ndash;<iframe src="dashboard" name="mainFrame" id="mainFrame"&ndash;&gt;-->
            <!--&lt;!&ndash;frameborder="no" class="embed-responsive-item" scrolling="auto"></iframe>&ndash;&gt;-->
            <!--</div>-->
        </div>
    </div>
    <!-- /.main-content -->

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>
</div>
<!-- /.main-container -->
<div id="loader-wrapper" style="display: none;">
    <!--<div class="ball-loader" >-->
        <!--Loading…-->
    <!--</div>-->
    <div class="throbber-loader">
        Loading…
    </div>
</div>

#parse("include/libs.html")

#[[
<!-- inline scripts related to this page -->
<script type="text/javascript">
    var clickHandler;
    jQuery(function ($) {
        clickHandler = function(e) {
            var url = $(this).attr('href');
            if(url === undefined) {
                return true;
            }
            if (url.indexOf('#') != -1) {
                return true;
            } else if (url.indexOf('javascript') != -1) {
                return true;
            } else if (url.indexOf('logout') != -1) {
                return true;
            }
            if($(this).attr('data-rel') == 'colorbox') {
                return true;
            }
            if(url.indexOf('http') != -1) {
                return true;
            }
            load(url);
            e.preventDefault();
            return false;
        };
        interceptHyperlinks();

        load('dashboard');

    });

    function showLoading() {
        $.blockUI({message:$('#loader-wrapper').html(),
            css: {
                border: 'none',
                padding: '15px',
                backgroundColor: 'transparent',
                opacity: 1,
            } , overlayCSS:{opacity:0.2}});

    }

    function hideLoading() {
        $.unblockUI();
        updatePermission();
    }

    function interceptHyperlinks() {
        $('a').unbind('click' , clickHandler).bind('click', clickHandler);
    }

    var commonOptions = {
        target:        '.main-content-inner',
        beforeSubmit:  function(formData, jqForm, options) {
            showLoading();
//                var queryString = $.param(formData);
//                alert('About to submit: \n\n' + queryString);
            return true;
        },
        success:function(responseText, statusText, xhr, $form)  {
            hideLoading();
            interceptHyperlinks();
            interceptSubmit();
//                alert('status: ' + statusText + '\n\nresponseText: \n' + responseText +
//                        '\n\nThe output div should have already been updated with the responseText.');
        },
        error:function() {
            interceptHyperlinks();
            interceptSubmit();
        }
    };

    function interceptSubmit() {
        $('form').each(function(){
            $(this).ajaxForm(commonOptions);
        });
    }

    function load(url) {
        showLoading();
        $('.main-content-inner').load(url, function (response, status, xhr) {
            hideLoading();
            interceptHyperlinks();
            interceptSubmit();
            if (status == "error") {
                console.log('加载失败，请稍候重试：' + xhr.status + response);
            }
        });
        return false;
    }


</script>
]]#

</body>
</html>
